package com.lzw.blog.admin.controller;

import com.lzw.blog.admin.model.params.PageParam;
import com.lzw.blog.admin.pojo.MessageBoard;
import com.lzw.blog.admin.service.MessageBoardService;
import com.lzw.blog.admin.service.TagService;
import com.lzw.blog.admin.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("admin/MessageBoard")
public class MessageBoardController {
    @Autowired
    private MessageBoardService messageBoardService;


    @PostMapping("MessageBoardList")
    public Result listmessageBoard(@RequestBody PageParam pageParam) {
        return messageBoardService.listMessageBoard(pageParam);
    }

    @GetMapping("delete/{id}")
    public Result deleteMessageBoardById(@PathVariable("id") Long id) {return messageBoardService.delete(id);}

    @PostMapping("update")
    public Result updateMessageBoard(@RequestBody MessageBoard messageBoard) {
        return messageBoardService.update(messageBoard);
    }
}
